<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>add</title>
</head>
<body>
    {%csrf_token%}
    <input type="text" id="i1">*<input type="text" id="i2">=<input type="text" id="i3">
    <input type="button" value="check result" id="b1">
    <p><span id="m1"></span></p>
    <script src="/static/js/jquery-3.6.0.js"></script>
    <script>
        $('#b1').click(function(){
            $.ajax({
                url:'/add/',
                type:'post',
                data:{
                    'i1': $('#i1').val(),
                    'i2': $('#i2').val(),
                    'i3': $('#i3').val(),
                    'csrfmiddlewaretoken':$("[name='csrfmiddlewaretoken']").val()
                     },
                success:function(res){
                    console.log(res);
                    if(res){
                        $('#m1').text(res);
                        }
                },
                error:function(err){
                    console.log(err);
                }
            })
        })
    </script>
</body>
</html>